package com.mate.cloud.xml.dtd;

import com.mate.cloud.xml.AbstractTestCase;
import org.dom4j.dtd.ElementDecl;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

/**
 * Tests the {@link ElementDecl}functionality. Tests each of the property
 * access methods and the serialization mechanisms. Correct parsing is tested by
 * {@link DocTypeTest}.
 * @author:         MI
 * @email:          448341911@qq.com
 * @createTime:     2024/6/3 14:57
 * @updateUser:     MI
 * @updateTime:     2024/6/3 14:57
 * @updateRemark:   修改内容
 * @version:        v1.0
 */
@SpringBootTest
public class ElementDeclTests extends AbstractTestCase {

    /**
     * Test
     *
     * <pre>
     *
     *  &lt;!ELEMENT an-element (#PCDATA)&gt;
     *
     * </pre>
     */
    @Test
    public void testSimpleElementDecl() {
        String expectedName = "an-element";

        String expectedModel = "(#PCDATA)";

        String expectedText = "<!ELEMENT an-element (#PCDATA)>";

        ElementDecl actual = new ElementDecl(expectedName, expectedModel);

        assertEquals("name is correct", expectedName, actual.getName());

        assertEquals("model is correct", expectedModel, actual.getModel());

        assertEquals("toString() is correct", expectedText, actual.toString());
    }

}
